﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StudentLib
{
    public class Student : BaseStudent, IRegister, IAttendClass
    {
        //fields
        private static int counter = 0;

        public static int Counter
        {
            get { return Student.counter; }
            set { Student.counter = value; }
        }
        int id = 0;

        public int Id
        {
            get { return id; }
            set { id = value; }
        }



        //methods
        bool isForWeb = false;
        public Student(bool isForWeb)
        {
            this.isForWeb = isForWeb;
            Student.counter += 1;
            this.id = Student.counter;
        }

        protected string GetSpace()
        {
            string space = "";
            if (isForWeb)
            {
                space = "&nbsp;";
            }
            else
            {
                space = " ";
            }

            return space;
        }

        protected string GetLineBreak()
        {
            string lineBreak = "";
            if (isForWeb)
            {
                lineBreak = "<br/>";
            }
            else
            {
                lineBreak  = "\r\n";
            }

            return lineBreak ;

        }

        public override string MailingLabel()
        {
            string label = FirstName + GetSpace() + LastName + GetLineBreak ();
            label += StreetAddress + GetLineBreak();
            label += City + GetSpace() + State + GetSpace() + Zip + GetLineBreak();

            return label;
        }


        public override string GetGrades()
        {
            return "<br/>Student Grades</br>";
        }

        public string Register()
        {
            throw new NotImplementedException();
        }

        string IAttendClass.AttendClass()
        {
            throw new NotImplementedException();
        }
    }
}
